<form class="form-horizontal group-border-dashed" method="POST">
    <div class="form-group">
      <label class="col-sm-2 control-label">{{"下载APP"|$.T}}</label>
      <div class="col-sm-9">
        <span class="form-control-plaintext">
          Google Authenticator 
          (<a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2" target="_blank">Android</a> | 
          <a href="https://apps.apple.com/app/google-authenticator/id388497605" target="_blank">iOS&iPad</a>)
          {{`或`|$.T}}
          <a href="https://authy.com/download/" target="_blank">Authy</a>
        </span>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-2 control-label">{{"APP绑定"|$.T}}</label>
      <div class="col-sm-9">
        <div class="table-responsive">
          <table class="table table-bordered" style="width:500px">
            <thead>
              <tr>
                <th width="250"><span class="label label-primary pull-right">{{"或"|$.T}}</span>{{"扫描二维码"|$.T}}</th>
                <th>{{"输入密钥"|$.T}}</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td><img src="{{$.Stored.qrCodeUrl}}" style="width:250px" alt=""></td>
                <td style="vertical-align:middle;text-align:center">
                  <span style="font-weight:bold;font-size:30px">{{$.Stored.keyData.Encoded}}</span></td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-2 control-label">{{"验证"|$.T}}</label>
      <div class="col-sm-9">
        <input class="form-control" type="text" name="code" value="{{$.Form `code`}}" required="required" placeholder="{{`验证码`|$.T}}">
        <div class="help-block">{{"在手机App上绑定之后，请在这里输入手机上显示的验证码，验证是否绑定成功"|$.T}}</div>
      </div>
    </div>
    {{- if gt (len $.Stored.step1SafeItems) 0 -}}
    <div class="form-group">
      <label class="col-sm-2 control-label">{{"前置条件"|$.T}}</label>
      <div class="col-sm-9">
        {{- $precondition := $.Form `precondition` -}}
        {{- $preconds := Split $precondition `,` -}}
        {{- range $k,$v := $.Stored.step1SafeItems -}}
        <span class="checkbox checkbox-primary checkbox-inline">
          <input type="checkbox" name="precondition" value="{{$v.K}}"{{if InSlice $v.K $preconds}} checked{{end}} id="precondition-{{$v.K}}">
          <label for="precondition-{{$v.K}}">{{$v.V|$.T}}</label>
        </span>
        {{- end -}}
      </div>
    </div>
    {{- end -}}
    <div class="form-group form-submit-group">
      <div class="col-sm-9 col-sm-offset-2">
        <button type="submit" class="btn btn-primary btn-lg"><i class="fa fa-check"></i> {{"验证并绑定"|$.T}}</button>
      </div>
    </div>
</form>